<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/template.xhtml">        
        <ui:define name="title">
            <h:outputText value="#{ruta.TituloCrearNuevo}"></h:outputText>
        </ui:define>
        <ui:define name="body">            

            <h:form id="frmCrearSocio">                

                <p:growl id="msgs" showDetail="true" />

                <p:panel header="Modificación de Ruta" style="font-size: small">
                    <h:inputHidden value="#{rutaController.selected.id}"/>
                    <table width="434" border="0">
                        <tr>
                            <th align="right" scope="row"><h:outputText value="#{ruta.Codigo}:"/></th>
                            <td align="left"><h:inputText id="txtCodigo" value="#{rutaController.selected.codigo}" title="#{ruta.Codigo}" required="true" requiredMessage="#{ruta.CampoNombre}" size="30"/></td>
                        </tr>
                        <tr>
                            <th  align="right" scope="row"><h:outputText value="#{ruta.Nombre}:"/></th>
                            <td  align="left"><h:inputText id="txtNombre" value="#{rutaController.selected.nombre}" title="#{ruta.Nombre}" required="true" requiredMessage="#{ruta.CampoApellido}" size="30"/></td>
                        </tr>
                        <tr>
                            <th  align="right" scope="row"><p:outputLabel for="time" value="#{ruta.InicioHora}" /></th>
                            <td  align="left">                                                                
                                <p:calendar id="time" value="#{rutaController.selected.inicioHora}" pattern="HH:mm" size="29" timeOnly="true"/>
                            </td>
                        </tr>
                        <tr>
                            <th  align="right" scope="row"><h:outputText value="#{ruta.FinHora}:"/></th>
                            <td  align="left">                                
                                <p:calendar id="time2" value="#{rutaController.selected.finHora}" pattern="HH:mm" size="29" timeOnly="true"/>                                
                            </td>
                        </tr>                           
                        <tr>
                            <th align="right" scope="row">#{ruta.Distancia}</th>
                            <td align="left"><h:inputText id="txtDistancia" value="#{rutaController.selected.distancia}" title="#{ruta.Distancia}" required="true" requiredMessage="#{ruta.CampoApellido}" size="30"/></td>
                        </tr>
                        <tr>
                            <th align="right" scope="row">#{ruta.NroUnidades}</th>
                            <td align="left"><h:inputText id="txtNroUnidades" value="#{rutaController.selected.numBuses}" title="#{ruta.NroUnidades}" required="true" requiredMessage="#{ruta.CampoApellido}" size="30"/></td>
                        </tr>
                        <tr>
                            <th align="right" scope="row"><p:outputLabel for="console" value="Tipo de Dia: " /></th>
                            <td>
                                <p:selectOneMenu id="console"  value="#{rutaController.selected.tipoDia}" >                                                                        
                                    <f:selectItem itemLabel="Ordinario" itemValue="Ordinario" />
                                    <f:selectItem itemLabel="Sábado" itemValue="Sábado" />
                                    <f:selectItem itemLabel="Domingo" itemValue="Domingo" />
                                </p:selectOneMenu>
                            </td>
                        </tr>
                        <tr>
                            <th align="right" scope="row">Estado:</th>
                            <td><p:selectBooleanCheckbox value="#{rutaController.selected.estado}"/></td>                                                   
                        </tr> 
                        <tr>                                
                            <th align="center" colspan="2" scope="row"><h:commandButton action="#{rutaController.modificarRuta()}" value="Guardar"/></th>
                        </tr>                                       
                    </table>   
                    <div align="left" style="font-size: small">                        
                        <p:commandLink ajax="false" 
                                       action="#{rutaController.cargarDetalleRuta(rutaController.selected.id)}" 
                                       value="#{ruta.Detalle}"
                                       rendered="#{accionController.getAccionByVista('Rutas', 'Ver')}"/>
                        <br />
                        <h:link outcome="Index" value="#{ayudante.RegresarIndex}"/>
                    </div> 
                </p:panel>                             
            </h:form>
        </ui:define>
    </ui:composition>
</html>

